<?php echo $this->element('user'); ?>

<script type="text/javascript">
$(document).ready(function(){
	$('#sortable').sortable();
});
</script>

<?php echo $form->create('Question', array('action'=>'order'));?>
<?php echo $form->hidden('id');?>

<fieldset>
<legend>Order Answers</legend>

<p align="left">Please select the order in which these answers should be place in order for the answer to be correct.</p>

<p align="left"><b>Question:</b>&nbsp;<?php echo $question['Question']['question'];?></p>

<ul id="sortable" align="center">
<?php 

	foreach ($question['Answer'] as $answer){
		echo '<li align="center" class="ui-state-default"><input type="hidden" name="data[Question][answer_id][]" value="'.$answer['id'].'">'.$answer['answer_text'].'</li>';
	}

?>
</ul>
<?php echo $form->end('Order Answers'); ?>
</fieldset>